/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  const jwt = app.middleware.jwt(app.config.jwt);

  router.post('/user/login', controller.user.login);
  router.get('/user/detail', controller.user.detail);

  router.get('/official_beer/list', controller.officialBeer.list);
  router.get('/official_beer/:id', controller.officialBeer.detail);
  router.post('/official_beer/add', controller.officialBeer.add);

  router.get('/user_beer_wall/list', controller.userBeerWall.list);
  router.get('/user_beer_wall/:id', controller.userBeerWall.detail);
  router.post('/user_beer_wall/add', controller.userBeerWall.add);

  router.get('/beer_record/list', jwt, controller.beerRecord.list);
  router.get('/beer_record/:id', controller.beerRecord.detail);
  router.post('/beer_record/add', controller.beerRecord.add);
};
